//
//  YTTrackCommonDefine.h
//  rpd_tracker
//
//  Created by PanCheng on 04/07/2017.
//  Copyright © 2017 Patrick Yang. All rights reserved.
//

#ifndef YTTrackCommonDefine_h
#define YTTrackCommonDefine_h

#define FACEDETECT_EXPORT __attribute__((visibility("default")))

namespace yt_backend_facetrackpro{
struct FACEDETECT_EXPORT YtFaceDetParam
{
    YtFaceDetParam();
    int min_face_size;//default=40; (12~max)
    float scale_factor;//default=1.414f; (1.1~2.5)
    
    float net1_threshold;//default=0.8f; (0.1~1.0)
    float net2_threshold;//default=0.8f; (0.3~1.0)
    float net3_threshold;//default=0.8f; (0.5~1.0)
    float final_threshold;//default=0.95f; (0.75~1.0)
    
    int max_face_size;//default=99999999; (12~max)
    bool bigger_face_mode;//default=false; (false/true)(attention: not biggest)
    bool non_square_rect;//default=false; (false/true)
    int extend_scale_num;//default=0; (1~max)
};



/** The face profile landmarks ordering
 *
 *     0                            20
 *     1                            19
 *      2                          18
 *      3                          17
 *       4                        16
 *        5                     15
 *         6                   14
 *          7                 13
 *            8              12
 *              9         11
 *                   10
 */
struct TC_FaceProfile
{
    std::vector<cv::Point2f> points;
};

/** The left eye and eyebrow landmarks ordering
 *
 *         7   6   5
 *    0                 4
 *         1   2   3
 */
struct TC_LeftEye
{
    std::vector<cv::Point2f> points;
};

struct TC_LeftEyebrow
{
    std::vector<cv::Point2f> points;
};


/** The right eye and eyebrow landmarks ordering
 *
 *         5   6   7
 *    4                 0
 *         3   2   1
 */
struct TC_RightEye
{
    std::vector<cv::Point2f> points;
};

struct TC_RightEyebrow
{
    std::vector<cv::Point2f> points;
};

/** The nose landmarks ordering
 *
 *           1
 *        2    12
 *      3        11
 *     4     0    10
 *    5  6  7  8   9
 */
struct TC_Nose
{
    std::vector<cv::Point2f> points;
};

/** The mouth landmarks ordering
 *
 *                 10   9   8
 *          11                      7
 *            21  20  19 18 17
 *    0                                    6
 *            12  13  14 15 16
 *           1                      5
 *                  2   3   4
 */

struct TC_Mouth
{
    std::vector<cv::Point2f> points;
};

/** The pupils ordering
 *
 *       0                          1
 */
struct TC_Pupil
{
    std::vector<cv::Point2f> points;
    
};

/************************
 * @brief 人脸配准关键点记录结构体, 具体结构参考以上的结构体定义
 * faceProfile: 人脸轮廓
 * leftEyebrow: 左眉毛
 * rightEyebrow: 右眉毛
 * leftEye: 左眼
 * rightEye: 右眼
 * nose: 鼻子
 * mouth: 嘴巴
 * pupil: 眼珠
 ************************/
struct TC_FaceShape
{
    TC_FaceProfile faceProfile;
    TC_LeftEyebrow leftEyebrow;
    TC_RightEyebrow rightEyebrow;
    TC_LeftEye leftEye;
    TC_RightEye rightEye;
    TC_Nose nose;
    TC_Mouth mouth;
    TC_Pupil pupil;
};

}
#endif /* YTTrackCommonDefine_h */
